﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using DailyDiet.Models;
using Microcharts;

namespace DailyDiet.Services
{
/*
 * 该类是一个recorderViewModel的辅助工具类，由于recorderViewModel的逻辑繁杂，
 * 因此提取改工具类简化其逻辑。
 *
 */
    /// <summary>
    /// RecorderPage的辅助工具类
    /// </summary>
    public interface IRecorderUtilService {
        Task<List<DietRecorder>> GetDietRecordersByMealTimesAsync(string MealTimes,
            DateTime date);

        Task<List<DietRecorder>> GetDietRecordersByDateAsync(DateTime date);

        List<ChartEntry> ConvertListIntoChartEntries(
            List<Diet> diets);

        List<ChartEntry> ConvertDictIntoChartEntries(
            Dictionary<string, List<Diet>> dictionary, string properties);

        Task<List<Diet>> ConvertRecordersIntoDietsAsync(List<DietRecorder> dietRecorders);

        Task<Dictionary<string, List<Diet>>>
            GetLongTermDietRecorderAsync(DateTime date, string model);
    }

    public static class RecorderUtilConstant {
        public const string LongTermModelWeek = "week";
        public const string LongTermModelMonth = "month";
        public static readonly string[]
            LongTermModels = new[] {"week", "month"};
    }

}
